package com.example.thornchg.yc_plane_game;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;

import org.cocos2d.layers.CCScene;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.opengl.CCGLSurfaceView;
import org.cocos2d.sound.SoundEngine;

public class MainActivity extends Activity {


    private CCDirector ccDirector;
    private SoundEngine soundEngine;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        CCGLSurfaceView ccglSurfaceView=new CCGLSurfaceView(this);
        setContentView(ccglSurfaceView);
         ccDirector = CCDirector.sharedDirector();
         ccDirector.attachInView(ccglSurfaceView);
         ccDirector.setDisplayFPS(true);
         ccDirector.setScreenSize(768f,1280f);
         CCScene ccScene=CCScene.node();
         ccScene.addChild(new LogoLayer());
         ccDirector.runWithScene(ccScene);
         soundEngine=SoundEngine.sharedEngine();
    }

    @Override
    protected void onPause() {
        super.onPause();
        soundEngine.pauseSound();
        ccDirector.pause();

    }

    @Override
    protected void onResume() {
        super.onResume();
        soundEngine.resumeSound();
        ccDirector.resume();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ccDirector.end();
    }
}
